<local:DocumentBase x:Class="WPFExcelReport.YCAFS05CHGR"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"                     
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    
                    FontSize="16"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:QtyColorConverter  x:Key="qtyc"/>          
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetData"/>
        <CollectionViewSource   x:Key="vwFSSTUELI" Source="{Binding Path=FSSTUELI,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwWDECK" Source="{Binding Path=WDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECK" Source="{Binding Path=FDECK,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwABPAUF" Source="{Binding Path=ABPAUF,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwABAUFM" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwSFSFARBEN" Source="{Binding Path=FSFARBEN,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwSFSGROE" Source="{Binding Path=FSGROE,Source={StaticResource SetData}}" />
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>

        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="5,0,0,0" Name="btnQuerySData" Click="btnQuerySData_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Find.png" />
                        </Button.Background>
                    </Button>
                </StackPanel>
                <StackPanel>
                    <TextBlock FontSize="18"   Width="Auto"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=原料}}" />
                    <ComboBox
                    Name="cbWTYE"
                    HorizontalAlignment="Left"
                    IsEditable="True"
                    Background="White"
                    IsTextSearchEnabled="True"
                    IsTextSearchCaseSensitive="False"                           
                    Width="Auto" 
                    >
                        <ComboBoxItem>成衣款式</ComboBoxItem>
                        <ComboBoxItem>面料</ComboBoxItem>
                        <ComboBoxItem>辅料</ComboBoxItem>
                        <ComboBoxItem>高级辅料</ComboBoxItem> 
                    </ComboBox>
                </StackPanel>
                <StackPanel> 
                    <WrapPanel>
                        <TextBox Background="Yellow"  FontSize="18"    Width="180" Name="txtMAT" CharacterCasing="Upper"  Text="" />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=现原料}}"></TextBlock>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBox Background="White"  FontSize="18"    Width="180" Name="txtNART" CharacterCasing="Upper"  Text="" />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=新原料}}"></TextBlock>
            </WrapPanel>
        </StackPanel>
                <StackPanel>
                    <Button Name="btnRefreshFS05" Click="btnRefreshFS05_Click" Margin="30,0,0,0" Height="40" Width="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=刷新BOM}}" Margin="30,0,0,0" ></TextBlock>
                </StackPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="btnRefreshAB" Click="btnRefreshAB_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=生产单列表}}" Margin="20,0,0,0" ></TextBlock>
                </StackPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="btnRefreshDECK" Click="btnRefreshDECK_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Upload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=更新全部}}" Margin="20,0,0,0" ></TextBlock>
                </StackPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0"  Click="btnReplaceSReq_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Upload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=逐个替换}}" Margin="20,0,0,0" ></TextBlock>
                </StackPanel>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1">
            <WrapPanel>
                <TextBlock Text="{Binding Source={Localization:Translate Word=款式：}}"></TextBlock>
            <TextBlock Background="Yellow" Width="120" Name="txtFART"  Text="{Binding FSSART, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBlock>
                <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"></TextBlock>
                <TextBox Background="LightBlue" Width="80" Text="{Binding FSSFARBE, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBox>
                <TextBlock Text="{Binding Source={Localization:Translate Word=尺码}}"></TextBlock>
                <TextBox Background="LightPink" Width="80" Text="{Binding FSSGROE, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBox>
                
            </WrapPanel>
            <StackPanel Grid.Row="1" Grid.Column="0" >
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=现原料}}"></TextBlock>
                        <TextBlock Background="Yellow" Width="120" Text="{Binding FSSMART, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"></TextBlock>
                    <TextBlock Background="Yellow" Width="80" Text="{Binding FSSMFARBE, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=尺码}}"></TextBlock>
                    <TextBlock Background="Yellow" Width="80" Text="{Binding FSSMGROE, Source={StaticResource ResourceKey=vwFSSTUELI}}"></TextBlock>
                  
                    
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=新原料}}"></TextBlock>
                    <TextBlock Background="White" Width="120" Name="txtNARTB"></TextBlock>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号}}"></TextBlock>
                    <ComboBox Background="LightBlue"
                                    Name="cbSFFARBE"
                                    HorizontalAlignment="Left"
                                    IsEditable="True" 
                                    IsTextSearchEnabled="True"
                                    IsTextSearchCaseSensitive="False"                           
                                    Width="Auto" 
                                    MinWidth="80"
                                    Text="{Binding FSSMFARBE, Source={StaticResource ResourceKey=vwFSSTUELI}}"
                                    DisplayMemberPath="FSFFARBE"
                                    SelectedValuePath="FSFFARBE"
                                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwSFSFARBEN}}"  
                                    >
                    </ComboBox>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=尺码}}"></TextBlock>
                    <ComboBox
                            Name="cbSFSIZE"
                            HorizontalAlignment="Left"
                            IsEditable="True"
                         Background="Yellow"
                            IsTextSearchEnabled="True"
                            IsTextSearchCaseSensitive="False"                           
                            Width="80" 
                        Text="{Binding FSSMGROE, Source={StaticResource ResourceKey=vwFSSTUELI}}"
                            DisplayMemberPath="FSGGROE"
                            SelectedValuePath="FSGGROE"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwSFSGROE}}"  
                    >
                    </ComboBox>
                </WrapPanel>
            </StackPanel>
            <StackPanel  Grid.Row="2" Grid.Column="0" >
             
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=用量}}"></TextBlock>
                    <TextBox Background="White" Name="txtSQTY" Text="{Binding FSSVERBR, Source={StaticResource ResourceKey=vwFSSTUELI}, Converter={StaticResource ResourceKey=d1000}}" Width="80"></TextBox>
                    <ComboBox
                                    Name="cbSMEEH"
                                    HorizontalAlignment="Left"
                                    IsEditable="True"
                                    Background="White"
                                    IsTextSearchEnabled="True"
                                    IsTextSearchCaseSensitive="False"                           
                                    Width="Auto" 
                                    >
                        <ComboBoxItem>PCS</ComboBoxItem>
                        <ComboBoxItem>M</ComboBoxItem>
                        <ComboBoxItem>MTR</ComboBoxItem>
                        <ComboBoxItem>KG</ComboBoxItem>
                    </ComboBox>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=损耗%}}"></TextBlock>
                    <TextBox Name="txtSWASTAGE" Background="White"  Text="{Binding FSSVERL, Source={StaticResource ResourceKey=vwFSSTUELI}, Converter={StaticResource ResourceKey=d100}}" Width="40"></TextBox>
                </WrapPanel>
            </StackPanel>
            <DataGrid  
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTUELI}}"  
                AutoGenerateColumns="False"
                Name="dlgFSSTUELI"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalAlignment="Stretch"
                HeadersVisibility="Column" 
                MaxHeight="600"
                FontSize="14"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"
                SelectionChanged="dlgFSSTUELI_SelectionChanged"
                RowDetailsVisibilityMode="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=描述}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSPOS}" Header="{Binding Source={Localization:Translate Word=行}}" Width="Auto" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=FSSFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=物料}}" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSSMGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺寸}}" Width="Auto" MinWidth="60" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1">
            <WrapPanel>

                <TextBlock Visibility="Hidden" Text="{Binding Source={Localization:Translate Word=选择生产单}}">:</TextBlock>
                <ComboBox Visibility="Hidden"  ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPAUF}}"
                            Margin="10,0,0,0"  FontSize="18"
                           Height="30"
                           VerticalAlignment="Top"
                               SelectionChanged="ABP_SelectionChanged"
                               Background="White"  MinWidth="150" 
                               DisplayMemberPath="ABPAUF"
                               IsEditable="True"
                               SelectedValuePath="ABPAUF"
                       />
            </WrapPanel>
            <TextBlock Name="txtMessage" Width="Auto"></TextBlock>
            <TextBlock Text="{Binding Source={Localization:Translate Word=辅料需求:}}"></TextBlock>
            <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                IsSynchronizedWithCurrentItem="True"
                Name="dlgFDECK"
                MaxHeight="300"
                FontSize="12"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECK}}"  
                Margin="0,1,0,0" 
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource ResourceKey=Trim}}"  Header="{Binding Source={Localization:Translate Word=款式}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=""   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=FDART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=FDFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=FDGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=FDMENGE}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="60" />
                </DataGrid.Columns>
            </DataGrid  >
            <TextBlock Text="{Binding Source={Localization:Translate Word=面料需求:}}"></TextBlock>
            <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                Name="dlgWDECK"
                MaxHeight="300"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECK}}"  
                Margin="0,1,0,0" 
                IsTextSearchCaseSensitive="True"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABPART, Converter={StaticResource ResourceKey=Trim}}"  Header="{Binding Source={Localization:Translate Word=款式}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=""   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=WDART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="120" />
                    <DataGridTextColumn Binding="{Binding Path=WDFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=WDBEDARF,Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="60" />
                </DataGrid.Columns>
            </DataGrid  >
            <DataGrid  
                CanUserReorderColumns="True"  
                CanUserResizeRows="True" 
                CanUserSortColumns="True"                  
                AutoGenerateColumns="False"   
                EnableRowVirtualization="False"   
                Name="dlgABAUFM"
                MaxHeight="300"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABAUFM}}"  
                Margin="0,1,0,0" 
                IsTextSearchCaseSensitive="True"  
                >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABAAUFTYP}" Header=""   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}" Header=""   Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD}" Header="{Binding Source={Localization:Translate Word=采购单}}"   Width="Auto" />
               </DataGrid.Columns>
            </DataGrid  >
        </StackPanel>
    </Grid>
</local:DocumentBase>
